from time import sleep
from class1905A.zoukao.zoukao2.BasePage import BasePage
from selenium.webdriver.common.by import By
class FengzPage3(BasePage):
    qunaerdl_slo = (By.XPATH,'//*[@id="__headerInfo_login__"]')  #点击登录
    qunaerdl1_slo = (By.XPATH,'//*[@id="app"]/div/div[2]/div/div[1]/div[4]/input')#勾选协议
    qunaerdl2_slo = (By.CLASS_NAME, 'desc')#点击其他方式登录
    qunaerdl3_slo = (By.CLASS_NAME, 'img')  # 点击QQ登录
    qunaerdl4_slo = (By.ID, 'ptlogin_iframe')  # 进入框架
    qunaerdl5_slo = (By.CLASS_NAME, 'link')  # 点击账号密码登录
    qunaerdl6_slo = (By.ID, 'u')  # 输入账号
    qunaerdl7_slo = (By.ID, 'p')  # 输入密码
    qunaerdl8_slo = (By.ID, 'login_button')  # 点击验证并登录
    ziyouxing_slo = (By.XPATH, '//*[@id="js_nva_cgy"]/li[7]/a')  # 点击自由行
    ziyouxing1_slo = (By.CLASS_NAME, 'qcbox-placeholder')  # 输入出发地
    ziyouxing2_slo = (By.CLASS_NAME, 'cinput.textbox')  # 输入目的地
    ziyouxing3_slo = (By.ID, 'freetrip_submit_btn')  # 点击立即搜索
    def dengl(self):
        self.find_element(*self.qunaerdl_slo).click()#点击登录
    def dengl1(self):
        self.find_element(*self.qunaerdl1_slo).click()  #勾选协议
    def dengl2(self):
        self.find_element(*self.qunaerdl2_slo).click()  #点击其他方式登录
    def dengl3(self):
        self.find_element(*self.qunaerdl2_slo).click()  #点击QQ登录
    def dengl4(self):
        self.driver.switch_to.frame(self.driver.find_element(*self.qunaerdl4_slo))# 进入框架
    def dengl5(self):
        self.find_element(*self.qunaerdl5_slo).click()  #点击账号密码登录
    def dengl6(self):
        self.find_element(*self.qunaerdl6_slo).send_keys('1547786171')  # 输入账号
    def dengl7(self):
        self.find_element(*self.qunaerdl7_slo).send_keys('chenxinyang.0827')  # 输入密码
    def dengl8(self):
        self.find_element(*self.qunaerdl8_slo).click()  # 点击验证并登录
    def zyx(self):
        self.find_element(*self.ziyouxing_slo).click()  # 点击自由行
    def zyx1(self):
        self.find_element(*self.ziyouxing1_slo).click()  # 输入出发地
    def zyx2(self):
        self.find_element(*self.ziyouxing2_slo).click()  # 输入目的地
    def zyx3(self):
        self.find_element(*self.ziyouxing3_slo).click()  # 点击立即搜索

    def qunaer_zhixing(self):
        self.driver.get('https://www.qunar.com/')
        sleep(2)
        self.driver.maximize_window()
        # sleep(2)
        # self.dengl()
        # sleep(2)
        # self.dengl1()
        # sleep(2)
        # self.dengl2()
        # sleep(2)
        # self.dengl3()
        # sleep(2)
        # self.dengl4()
        # sleep(2)
        # self.dengl5()
        # sleep(2)
        # self.dengl6()
        # self.dengl7()
        # sleep(2)
        # self.dengl8()
        # sleep(2)
        # self.zyx()
        # sleep(2)
        # self.zyx1()
        # self.zyx2()
        # sleep(2)
        # self.zyx3()
        # sleep(2)
